<template>
    <div :class="`shop-order-discount ${mode}`">
        <TechCell class="base-discount" v-if="deliveryPrice" title="配送费" :value="`￥${deliveryPrice.toFixed(2)}`" :mode="mode" />
        <template v-for="(item, index) in discountList">
            <TechCell :key="index" :title="item.name" type="red" :value="`- ￥${item.discount / 100}`" />
        </template>
    </div>
</template>

<script>
import { TechCell } from '@components/base';
import ModeMixin from '@common/mixin';
export default {
    name: 'OrderDiscount', // 订单优惠信息
    mixins: [ModeMixin],
    components: {
        TechCell,
    },
    props: {
        discountList: {
            type: Array,
            default: () => [],
        },
        deliveryPrice: Number,
    },
};
</script>

<style lang="less">
.shop-order-discount {
    font-family: @font-family-number;
    &.black {
        .base-discount .tech-cell-value {
            color: @black-title-color;
        }
    }
}
</style>
